source PAC.tcl
source univers.tcl
source minimap.tcl
source map.tcl
# JeuA --
#


inherit JeuA Abstraction
method JeuA constructor {control } {
   this inherited $control 
}

method JeuA destructor {} {
   this inherited
}



# JeuP --
#


inherit JeuP Presentation
method JeuP constructor {control} {
	this inherited $control
	set this(window) [toplevel ._${className}] 
	wm title $this(window) "WarLight"
	#wm protocol $this(window) WM_DELETE_WINDOW "$this(control) dispose"
	wm protocol $this(window) WM_DELETE_WINDOW check_exit
   
	set this(miniMapCanvas) [canvas $this(window).miniMap -width 200 -height 200 ]
	set this(mapCanvas) [canvas $this(window).map -width 550 -height 550 ]
	set this(infoCanvas) [canvas $this(window).info -width 200 -height 350 ]
	
	$this(miniMapCanvas) create rectangle 2 2 200 200 -width 1
	$this(mapCanvas) create rectangle 2 2 550 550 -width 1
	$this(infoCanvas) create rectangle 2 2 200 350 -width 1
	
	grid $this(miniMapCanvas)  -row 1 -column 1 
	grid $this(infoCanvas)  -row 2 -column 1 
	grid $this(mapCanvas)   -row 1 -rowspan 2 -column 2
	
}

method JeuP getMiniMap {} {
	return [ MiniMap tempMiniMapCanvas $this(miniMapCanvas) ]
}

method JeuP getMap {} {
	return [ Map tempMapCanvas $this(mapCanvas) ]
}

proc destructor {} {
   destroy $this(window)
}

proc check_exit {} {
	set ans [tk_messageBox -type yesno -icon question -message "Voulez-vous vraiement fermer WarLight ? La partie sera perdue. "]
	if { $ans != "no" } {
		exit
	}
 }

# Jeu --
#


inherit Jeu Control
method Jeu constructor {} {
   JeuA ${objName}_abst $objName 
   JeuP ${objName}_pres $objName
   this inherited "" ${objName}_abst ${objName}_pres
   
   set this(univers) [ Univers universe [$this(presentation) getMap] [$this(presentation) getMiniMap] ]
   $this(univers) draw 
}

method Jeu destructor {} {
   this inherited
}

Jeu j